import request from "@/utils/request";

// 查询问题数据列表
export function listQuestion(query) {
  return request({
    url: "/system/question/list",
    method: "get",
    params: query,
  });
}

// 查询问题数据列表
export function treelistQuestion(query) {
  return request({
    url: "/system/question/treelist",
    method: "get",
    params: query,
  });
}

export function treelistQuestionWithRecord(query) {
  return request({
    url: "/system/question/treelistwithrecord",
    method: "get",
    params: query,
  });
}

// 查询问题数据详细
export function getQuestion(questionId) {
  return request({
    url: "/system/question/" + questionId,
    method: "get",
  });
}

// 新增问题数据
export function addQuestion(data) {
  return request({
    url: "/system/question",
    method: "post",
    data: data,
  });
}

// 修改问题数据
export function updateQuestion(data) {
  return request({
    url: "/system/question",
    method: "put",
    data: data,
  });
}

// 删除问题数据
export function delQuestion(questionId) {
  return request({
    url: "/system/question/" + questionId,
    method: "delete",
  });
}

export function getQuestions(questionIds) {
  return request({
    url: "/system/question/" + questionIds,
    method: "get",
  });
}

/**
 * 设置权重
 * @param {*} data
 * @returns
 */
export function setQuestion(data) {
  return request({
    url: "/system/question",
    method: "put",
    data: data,
  });
}
/**
 * 获取权重
 * @param {*} data
 * @returns
 */
// export function getQuestion(id) {
//   return request({
//     url: "/system/question" + id,
//     method: "get",
//   });
// }
